﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Kriptadd
{
    class dnacrypt
    {
        char adenin = 'A';
        char guanin = 'G';
        char cytosin = 'C';
        char timin = 'T';
        char urasil = 'U';
        
        string convertToRNAString(string teks){
            StringBuilder strbldr = new StringBuilder();
            int count = 0;
            while (count <= teks.Length - 1) {
                if (teks.ElementAt(count) == timin) { strbldr.Append(urasil); }
                else if ((teks.ElementAt(count)!=adenin)&&(teks.ElementAt(count)!=cytosin)&&(teks.ElementAt(count)!=guanin)){ strbldr.Append('X'); }
                else{}
                count++;
            }
            return strbldr.ToString();
        }

        string reverseAllString(string teks) { 
            StringBuilder strbldr = new StringBuilder();
            strbldr.Append(adenin);
            strbldr.Append(urasil);
            strbldr.Append(guanin);
            int count = 0;
            while (count <= teks.Length - 1) {
                if (teks.ElementAt(count) == adenin) { strbldr.Append(urasil); }
                else if (teks.ElementAt(count) == guanin) { strbldr.Append(cytosin); }
                else if (teks.ElementAt(count) == cytosin) { strbldr.Append(guanin); }
                else if (teks.ElementAt(count) == timin) { strbldr.Append(adenin); }
                else { strbldr.Append('X'); }
                count++;
            }
            strbldr.Append(urasil);
            strbldr.Append(adenin);
            strbldr.Append(guanin);
            return strbldr.ToString();
        }
        
        char reverseAllChar(char teks) {
            if (teks == adenin) { return urasil; }
            else if (teks == guanin) { return cytosin; }
            else if (teks == cytosin) { return guanin; }
            else if (teks == timin) { return adenin; }
            else { return 'X'; }
        }
    }
}
